package mobile.map;

import android.app.Activity;
import android.graphics.Typeface;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class FHMinToast {
	
	private static Toast myToast;
	
	public static void ShowText(Activity act, String textToShow) {
		LayoutInflater inflater = act.getLayoutInflater();
		View layout = inflater.inflate(R.layout.toast_layout,
		                               (ViewGroup) act.findViewById(R.id.toast_layout_root));

		TextView text = (TextView) layout.findViewById(R.id.text);
		ImageView image = (ImageView) layout.findViewById(R.id.image);
		image.setImageResource(R.drawable.cropped_1);
		Typeface tf = Typeface.createFromAsset(act.getAssets(), "fonts/calibri.otf");
		text.setTypeface(tf);

		myToast = new Toast(act.getApplicationContext());
		myToast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
		myToast.setDuration(Toast.LENGTH_LONG);
		myToast.setView(layout);
		text.setText(textToShow);
		myToast.show();
	}

}
